x=[1,2,3,4]
y=[1,2,3,4,5]

def remove_mid_item(x):
    n=len(x)
    if n%2 != 0:
        x.pop(int(n/2))
    else:
        t=int(n/2)
        x.pop(t)
        x.pop(t-1)
    return x
print(x)

r5=remove_mid_item(x)
print(r5)

r5=remove_mid_item(y)


print(r5)
